package com.yunhe.biz;

import java.util.List;
import java.util.Map;

import com.yunhe.dao.IOrders;
import com.yunhe.dao.OrdersImpl;
import com.yunhe.entity.Goods;
import com.yunhe.entity.Orders;
import com.yunhe.entity.User;

public class OrdersBizImpl implements IOrdersBiz {

	IOrders io = new OrdersImpl();
	@Override
	public boolean addOrder(Goods goods, User user, int number, String address, String remark) {
		int count = io.addOrder(goods, user, number, address, remark);
		if(count>0){
			return true;
		}else{
			return false;
		}
	}
	@Override
	public boolean updateOrders(Orders orders, int price, int number, String address, String remark,int state) {
		int count = io.updateOrders(orders, price, number, address, remark, state);
		if(count>0){
			return true;
		}else{
			return false;
		}
	}
	@Override
	public boolean delOrders(Orders orders) {
		int count = io.delOrders(orders);
		if(count>0){
			return true;
		}else{
			return false;
		}
	}
	@Override
	public List<Map> getAllOrders() {
		List<Map> map = io.getAllOrders();
		return map;
	}
}
